package com.example.springbootlearn.netty.handler;


import com.example.springbootlearn.netty.annotation.NettyHandler;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Slf4j
@Component
@ChannelHandler.Sharable
@NettyHandler(value = 101)
public class StringMsgHandler extends SimpleChannelInboundHandler<String> {

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, String info) {
//        log.info("收到来自的消息：{}", info);

        log.info("线程名字：{} channelId：{} 收到来自的消息：{}", Thread.currentThread().getName(), ctx.channel().id(), info);
    }
}